<%@ page language="java" import="java.util.*" pageEncoding="utf8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<div class="DaoHang">您当前位置：<a href="Index">淘商城</a> &gt; 我的购物车</div>


<div class="cartbox">
    <div class="logintips"><strong>
        <font color=ff6600>
            <c:if test="${niit_bc_user == null }">温馨提示：您还没有注册或登录。享受更多会员优惠，请先<a href="login.jsp">登录</a>或<a href="register.jsp" target="_blank">注册</a>成为商城会员！</c:if>
            <c:if test="${niit_bc_user != null }">温馨提示：${ niit_bc_user.userName},欢迎您，您是第${niit_bc_user.userLoginTime}次登录,请确认</c:if>
        </font></strong></div>
    <div class="ShoppingCart">
        <form method="POST" name="check">
            <table border="0" cellspacing="1" cellpadding="1" align="center" width="100%" class="border">
                <tr class='title' height="25">
                    <td width="6%" align="center">编 号</td>
                    <td align="center">商 品 名 称</td>
                    <td width="10%" align="center">数 量</td>
                    <td width="10%" align="center">单价</td>
                    <td width="12%" align="center">总 计</td>
                    <td width="22%" align="center">操作</td>
                </tr>
                <c:if test="${niit_bc_cart == null }">
                    <tr class='tdbg'>
                        <td colspan=2>您的购物车没有商品!</td>
                        <td colspan=4><a href='Index'><img src="images/shop_btn3.gif" border=0></a></td>
                    </tr>
                </c:if>
                <c:if test="${niit_bc_cart != null }">
                    <tr style="height:15px;">
                        <td colspan=8>&nbsp;</td>
                    </tr>
                </c:if>


                <c:if test="${cartList != null }">
                    <c:forEach items="${cartList }" var="bookList">

                        <tr class='tdbg' height="25" align="center">
                            <td><input type="CheckBox" name="cartid" value="2" Checked></td>
                            <td align="left" valign="top">
                                <a href="ShowBook?bookId=${bookList.bookId }" target="_blank"><img
                                        src="${bookList.bookPhoto }" alt="${bookList.bookName }" width="50" height="50"
                                        align="left" style="border:1px solid #ccc;padding:2px"/></a>
                                <a href="ShowBook?bookId=${bookList.bookId }"
                                   target="_blank">${bookList.bookName }</a><br/>
                            </td>
                            <td><input type="Text" name="Q_2" value="${bookList.bookCount }" size="5"
                                       style="text-align:center" class="textbox"></td>
                            <td>￥${bookList.bookPrice }</td>
                            <td>￥${bookList.bookAllPrice }</td>
                            <td><a href="javascript:void(0);"
                                   onclick="window.location.href='CartOperate?op=add&bookCount=1&bookId=${bookList.bookId }'"
                                   id="add">增加</a>
                                <a href="javascript:void(0);"
                                   onclick="window.location.href='CartOperate?op=minus&bookCount=1&bookId=${bookList.bookId }'"
                                   id="minus">减少</a>
                                <a href="javascript:void(0);"
                                   onclick="window.location.href='CartOperate?op=delete&bookId=${bookList.bookId }'"
                                   id="delete">删除</a>
                            </td>
                        </tr>


                    </c:forEach>
                    <tr class='tdbg'>
                        <td colspan="5" align="center" nowrap><font color="#ff6600">清空购物车物品，请按“清空购物车”按钮</font>
                            <a href="CartOperate?op=deleteAll"><img src="images/shop_btn1.gif" border=0></a>

                            <c:if test="${niit_bc_user == null }">
                                <input type="image" name="payment" src="images/shop_btn2.gif"
                                       onclick="alert('请登录后下订单')">&nbsp;
                            </c:if>
                            <c:if test="${niit_bc_user != null }">
                                <input type="image" name="payment" src="images/shop_btn2.gif"
                                       onclick="this.form.action='Order';this.form.target='_parent';">&nbsp;
                            </c:if>

                            <a href='Index'><img src="images/shop_btn3.gif" border=0></a>
                        </td>
                        <td height="25" align="center">合计：
                            <font color="#FF6600"> <c:if test="${niit_bc_cart == null }">￥0</c:if><c:if
                                    test="${niit_bc_cart != null }">￥${niit_bc_cart.cartAllPrice }</c:if></font>&nbsp;元
                        </td>
                    </tr>
                </c:if>

            </table>
        </form>
    </div>
</div>
